package com.martin.vista;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.util.logging.Logger;

import javax.swing.JFrame;
import javax.swing.JMenuBar;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;

/**
 * Main frame para la GUI
 * 
 */
public class MainFrame extends JFrame {

	public static final long serialVersionUID = 1;
	public static final int k_width = 800;
	public static final int k_height = 500;
	private final ControladorGUI guiController;

	public MainFrame(ControladorGUI guiController) {
		this.guiController = guiController;
		configurarFrame();
		agregarComponentes();
	}

	private void configurarFrame() {
		this.setSize(k_width, k_height);
		this.setMinimumSize(new Dimension(k_width, k_height));
		this.setTitle("Sorteo!");
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	}

	private void agregarComponentes() {
		// Crea el frame del panel interno
		JPanel panel = new JPanel();
		panel.setLayout(new BorderLayout());

		// Crea el menu
		JMenuBar menuBar = new BarraMenu(guiController);
		panel.add(menuBar, BorderLayout.NORTH);

		// Crea el panel indexado interior
//		JTabbedPane tabParticipantes = new ParticipantesTab(guiController);
//		panel.add(tabParticipantes, BorderLayout.CENTER);

		this.add(panel);
	}

	private static final Logger LOG = Logger.getLogger(MainFrame.class
			.getName());
}
